package com.gaga.console.core.entity.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * <p>
 * 话术vo
 * </p>
 *
 * @author liujia
 * @since 2022-05-19
 */
@Data
@ApiModel("语音合成请求参数")
public class TextToSpeechDto implements Serializable {

    @ApiModelProperty("需要合成的文本内容")
    @NotNull
    private String text;

    @ApiModelProperty("文本语言代码")
    @JsonProperty("text_lang")
    private String textLang = "中文";

    @ApiModelProperty("参考音频文件路径")
    @JsonProperty("ref_audio_path")
    private String refAudioPath;

    @ApiModelProperty("提示文本语言")
    @JsonProperty("prompt_lang")
    private String promptLang = "中文";

    @ApiModelProperty("参考音频对应的文本提示")
    @JsonProperty("prompt_text")
    private String promptText;

    @ApiModelProperty("采样时保留概率最高的前k个选项")
    @JsonProperty("top_k")
    private Integer topK = 20;

    @ApiModelProperty("累积概率阈值采样")
    @JsonProperty("top_p")
    private Integer topP = 1;

    @ApiModelProperty("采样温度")
    private Integer temperature = 1;

    @ApiModelProperty("重复惩罚系数")
    @JsonProperty("repetition_penalty")
    private Double repetitionPenalty = 1.35;

    @ApiModelProperty("文本分段方法")
    @JsonProperty("text_split_method")
    private String textSplitMethod = "凑50字一切";

    @ApiModelProperty("批处理大小")
    @JsonProperty("batch_size")
    private Integer batchSize = 20;

    @ApiModelProperty("是否将批次分成多个桶")
    @JsonProperty("split_bucket")
    private Boolean splitBucket = true;

    @ApiModelProperty("生成语音的速度因子")
    @JsonProperty("speed_factor")
    private Integer speedFactor = 1;

    @ApiModelProperty("音频片段间隔")
    @JsonProperty("fragment_interval")
    private Float fragmentInterval = 0.1f;

    @ApiModelProperty("随机种子")
    private Long seed = -1L;

    @ApiModelProperty("并行推理开关")
    @JsonProperty("parallel_infer")
    private Boolean parallelInfer = true;

    @JsonProperty("ref_text_free")
    private Boolean refTextFree = false;

    @JsonProperty("keep_random")
    private Boolean keepRandom = true;

}
